#pragma once

#include <stdexcept>

class UartParamError : public std::exception {
private:
    std::string _errorMsg;

public:
    UartParamError(const std::string &err) : _errorMsg(err){};

    UartParamError(const UartParamError &) = default;
    UartParamError(UartParamError &&) noexcept = default;

    UartParamError &operator=(const UartParamError &) = default;
    UartParamError &operator=(UartParamError &&) noexcept = default;

    virtual const char *what() const noexcept override { return _errorMsg.c_str(); }
};